package com.os.concurrent;

import java.util.concurrent.Callable;

public class Task implements Callable<Double> {

    @Override
    public Double call() throws Exception {
        //以异步的方式在新的线程中执行耗时的操作
        try {
            System.out.println("开始做一些计算操作。。。");
            Thread.sleep(3000);
            System.out.println("计算结束。。。");
        }catch (InterruptedException e){
            throw new RuntimeException();
        }
        return 1.0;
    }
}
